<?php
/**
 * @package scuttle
 * @file /admin/actions/WatchedListAction.class.php
 **/
 
if (!defined('XOOPS_ROOT_PATH')) exit();

require_once XOOPS_MODULE_PATH. '/scuttle/class/AbstractListAction.class.php';
require_once XOOPS_MODULE_PATH. '/scuttle/admin/forms/WatchedAdminFilterForm.class.php';
require_once XOOPS_MODULE_PATH. '/scuttle/admin/include/functions.php';


class Scuttle_WatchedListAction extends Scuttle_AbstractListAction
{
	var $mObject = null;


	var $breadCrumbs     = array();
	var $confirmMssage   = null;
	var $moduleHeader    = null;
	function &_getHandler()
	{
		$handler =& xoops_getmodulehandler('watched');
		return $handler;
	}

	function &_getFilterForm()
	{
		$filter =& new Scuttle_WatchedFilterForm($this->_getPageNavi(), $this->_getHandler());
		return $filter;
	}
	function _getBaseUrl()
	{
		return 'index.php?action=WatchedList';
	}
	function getDefaultView(&$controller, &$xoopsUser)
	{
		$this->mFilter =& $this->_getFilterForm();
		$this->mFilter->fetch();

		$handler =& $this->_getHandler();
		$this->mObjects =& $handler->getObjects($this->mFilter->getCriteria());
		$this->countData = count($this->mObjects) ;

		return SC_FRAME_VIEW_INDEX;
	}



	function executeViewIndex(&$controller, &$xoopsUser, &$render)
	{
		global $adminmenu;
		$this->breadCrumbs[] = array('name' => _AD_SC_MAIN) ;
		$render->setTemplateName('scuttle_watched_list.html');
		$render->setAttribute('module_info'   , getModuleInfo());
		$render->setAttribute('module_header' , $this->moduleHeader);
		$render->setAttribute('bread_crumbs'  , $this->breadCrumbs);
		$render->setAttribute('set_menu'      , $adminmenu );
		$render->setAttribute('set_menu_no'   , 4);
		$render->setAttribute('set_menu_desc' , $this->menuDescription);
		$render->setAttribute('confirm_mssage', $this->confirmMssage);
		$render->setAttribute('objects'       , $this->mObjects);
		$render->setAttribute("pageNavi"      , $this->mFilter->mNavi);
	}

}
?>